<!-- LEFT -->
 <?php 
 if(!$this->inbox){
    $this->inbox = array();
 }

 $cate = JRequest::getVar('cate');
 echo $this->loadTemplate('left','default');

 ?>
 <!-- END LEFT -->
 <script src="../media/system/js/mootools-core.js" type="text/javascript"></script>
<script src="../media/system/js/core.js" type="text/javascript"></script>

 <form action="index.php?top=page&option=com_frmessage&cate=<?php echo $cate ?>" method="post" name="adminForm" id="adminForm">
     <div id="jm-content">
        <!-- SEARCH MESS -->                   
        
        <?php echo $this->loadTemplate('toolbar','default'); ?>
            <div style="width: 100%;">
            <br />
                <table border=1 id="tb_blue">
                    <thead>
                			<tr>
                				<th width="1%">
                					<input type="checkbox" name="checkall-toggle" value="" title="Check All" onclick="Joomla.checkAll(this)"/>
                				</th>
                				<th width="15%">ステータス</th>
                				<th width="15%">宛先、</th>
                				<th width="">件名</th>
                				<th width="15%">日付</th>
                			</tr>
                		</thead> 
                		
                		<tbody>
                            <?php foreach($this->inbox as $k=>$mes):
                            if($cate == 'draft'){
                                $link = "<a href='index.php?top=page&option=com_frmessage&task=reply&noHead=true&cate=$cate&cid[]=$mes->MESE_CODE'>$mes->MESE_TITLE</a>";
                            }else{
                                $link = "<a href='index.php?top=page&option=com_frmessage&task=view&cate=$cate&cid[]=$mes->MESE_CODE'>$mes->MESE_TITLE</a>";
                            }
                            
                    		  echo '<tr class="row'.($k+1).'">';
                    			echo "<td><input type='checkbox' id='cb$k' name='cid[]' value='$mes->MESE_CODE' onclick='Joomla.isChecked(this.checked);'/></td>";
                    			echo "<td>".$this->model->checkFlag($mes, 'MESE')."</td>";
                    			echo "<td >$mes->MESE_OCBA_CODE_LIST</td>";
                                echo "<td>$link</td>";
                                echo "<td >".date('Y/m/d', strtotime($mes->MESE_DATE))."</td>";
                    		  echo "</tr>";
                            endforeach ?>
                          
                    	</tbody>
                        
                        <tfoot>
                			<tr>
                				<td colspan="15">
                					<div class="container"><div class="pagination">
                                    
                                    <div class="button2-right off"><div class="start"><span>最初ページへ</span></div></div><div class="button2-right off"><div class="prev"><span>前へ</span></div></div>
                                    <div class="button2-left"><div class="page"><span>1</span><a href="#" title="2" onclick="document.adminForm.limitstart.value=20; Joomla.submitform();return false;">2</a><a href="#" title="3" onclick="document.adminForm.limitstart.value=40; Joomla.submitform();return false;">3</a><a href="#" title="4" onclick="document.adminForm.limitstart.value=60; Joomla.submitform();return false;">4</a>
                                    </div></div><div class="button2-left"><div class="next"><a href="#" title="Next" onclick="document.adminForm.limitstart.value=20; Joomla.submitform();return false;">次へ</a></div></div><div class="button2-left"><div class="end"><a href="#" title="End" onclick="document.adminForm.limitstart.value=60; Joomla.submitform();return false;">最後ページへ</a></div></div>
                
                                    <input type="hidden" name="limitstart" value="0"/>
                                        </div>
                                    </div>				
                                </td>
                			</tr>
                		</tfoot>
                </table>
                <div>
                    <input type="hidden" name="boxchecked"/>
                    <input type="hidden" name="task" id="task" value=""/>
                </div>
             </div>    
         </div>
         
    </form>
<script>
jQuery().ready(function(){
    jQuery('#toolbar-box').css('display','none');
    jQuery('#down-arrow').click(function(){
        jQuery('#content-search').toggle();
        return false;
    })
})
</script>
 <!-- END CONTENT -->
                           


 
<script>
    jq(document).ready(function() {
        
        // show a dialog box when clicking on a link
        jq('#icon').bind('click', function(e) {
            e.preventDefault();
            jq.Zebra_Dialog('', {
                source:  {'ajax': 'index.php?top=page&option=com_frcenter&task=icon&tmpl=component'},
                height: 500,
                width: 500,
                title:  '【アイコン】ページ',
                type:  '',

            });
        });
    })
</script>
